package com.credithc.customers.base.ro;

import com.credithc.customers.base.codes.CustomerCodes;
import com.credithc.customers.base.exception.CustomerException;
import lombok.Data;
import org.apache.commons.lang.StringUtils;

/**
 * @description: 用户获取邀请码入参
 * @author: fby
 * @date: 2020/09/01 14:33
 * @param: null
 * @return:
 */
@Data
public class CustomerInvitationRo extends CustomerBaseRo {

    private String preCustomerNo;

    public static void checkBaseParam(CustomerInvitationRo ro) {
        if (StringUtils.isBlank(ro.getPreCustomerNo())) {
            throw new CustomerException(CustomerCodes.PARAM_VALIDATE_ERROR, "用户号不能为空");
        }
        if (StringUtils.isBlank(ro.getRequestNo())) {
            throw new CustomerException(CustomerCodes.PARAM_VALIDATE_ERROR, "请求流水号不能为空");
        }
    }

}
